@extends('default.layouts.english.companyPublic')

@section('title', '职位管理')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/company/list.css')}}">
@endsection

@section('rightcon')
    <div class="right">
        <div class="jright">
            <div class="content">
                <div class="jobtitle">
                    <div class="tithead">
                        <ul>
                         <li class="active"><a href="{{url('company/english/jobadmin')}}">{{trans('english.manage')}}</a></li>
                         <li><a href="{{url('company/english/browse_job')}}">{{trans('english.visited')}}</a></li>
                        </ul>
                    </div>
                </div>
                {{--\搜索内容--}}
                <div class="jobsearch">
                    <form name="Formso" action="{{url('company/english/jobadmin')}}" method="post">
                        {!! csrf_field() !!}
                        <span><input name="keyWord" class="keyWord" value="" id="keyWord" placeholder="{{trans('english.pleaseEnter')}}" type="text"/></span>
                         <span><input name="submit" class="searpos" value="" id="" type="submit"/></span>
                    </form>
                </div>
				<div class="addpos"><a href="{{url('company/english/jobpublish')}}"><i></i>{{trans('english.TheNew')}}</a></div>
                {{--显示列表--}}
                <div class="pinfo">
                    <form name="thisForm" action="{{url('company/jobadmin')}}" method="post">
                        {!! csrf_field() !!}
                        <div class="listmenu">
                                <ul class="one">
                                    <li class="p1"></li>
                                    <li class="p2">{{trans('english.JobName')}}</li>
                                    <li class="p4">{{trans('english.Monthly')}}</li>
                                    <li class="p3">
                                        <div class="status">
                                            <input id="job_status" name="job_status" value="{{$job_status}}" type="hidden">
                                            <div id="job_status_select" class="select" style="width:126px; height:28px; line-height: 28px;">
                                                <span><a></a></span><i></i>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="p100">{{trans('english.Recruit')}}</li>
                                    <li class="p200">{{trans('english.operation')}}</li>
                                </ul>
                            <div class="information"><span>{{trans('english.valid')}}<em> {{$joblist->total()}} </em>Entries！</span></div>
                            {{--循环--}}
                            @if($joblist->count() > 0 )
                                @foreach($joblist as $v)
                                    <ul id="list{{$v->id}}">
                                        <li class="p1">
                                            <input name="selected_id[]" class="checkboxs" value="{{$v->id}}" type="checkbox"/>
                                        </li>
                                        <li class="p2"><a target="_blank" class="linkbright" href="{{url('jobinfo_'.idEncryption($v->id).'.html')}}">{{str_limit($v->job_title,24)}}</a>@if($v->iurgent==1)<i class="iurgent"></i>@endif</li>
                                        <li class="p4">
                                            <span class="jpost">@if($v->salary_above){{$v->salary_above}}~{{$v->salary_below}}@else Negotiable @endif</span>
                                        </li>
                                        <li class="p3">
                                            @if($v->job_status == '1')
                                                <span class="statusval">{{trans('english.release')}}</span>
                                            @elseif($v->job_status == '2')
                                                <span class="statusval declined">{{trans('english.shielding')}}</span>
                                            @elseif($v->job_status == '0')
                                                <span class="statusval declined">{{trans('english.audit')}}</span>
                                            @endif
                                        </li>
                                        <li class="p100">@if($v->recruiting_num == '0') Several @else {{$v->recruiting_num}} name @endif</li>
                                        <li class="p200" id="operate">
                                        	<a href="{{url('company/english/job/'.$v->id.'/edit')}}"><i tip="{{trans('english.editor')}}" class="p edit"></i></a>
                                            <a href="{{url('company/english/job/'.$v->id.'/edit')}}?type=publish"><i tip="{{trans('english.Clone')}}" class="p cp"></i></a>
                                            <a onclick="destroy('{{url('company/job_status')}}?id={{$v->id}}&status=2','{{trans('english.block')}}')"><i tip="{{trans('english.Shield')}}" class="p act"></i></a>
                                            <a onclick="destroy('{{url('company/job_status')}}?id={{$v->id}}&status=1','{{trans('english.activate')}}')"><i tip="{{trans('english.Activation')}}" class="p shield"></i></a>
                                            <a onclick="destroy('{{url('company/urgent')}}?id={{$v->id}}','{{trans('english.express')}}')"><i tip="{{trans('english.Urgent')}}" class="p urgent"></i></a>
                                        	<a onclick="destroy('{{url('company/job_status')}}?id={{$v->id}}&status=4','{{trans('english.sure')}}')"><i tip="{{trans('english.delete')}}" class="p del"></i></a>
                                        </li>
                                    </ul>
                                @endforeach
                            @else
                                <div class="nullcon">{{trans('english.Records')}}</div>
                            @endif
                            <ul class="one last">
                                <li class="p1" style="width:80px;">
                                    <input name="selectall" id="selectall" class="checkboxs" value="234" type="checkbox" onclick="CheckAll(this)"/>
                                    <label for="selectall">Check</label>
                                </li>
                                <li class="p800">
                                    <span class="pborder" onclick="showconfirm('{{url('company/refresh')}}','5')">{{trans('english.Refresh')}}</span>
                                	<span class="pborder" onclick="showconfirm('{{url('company/job_status')}}','2')">{{trans('english.Shield')}}</span>
                                    <span class="pborder" onclick="showconfirm('{{url('company/job_status')}}','1')">{{trans('english.Activation')}}</span>
                                    <span class="pborder" onclick="showconfirm('{{url('company/job_status')}}','4')">{{trans('english.delete')}}</span>
                                </li>
                            </ul>
                        </div>
                    </form>
                </div>
                {{--分页--}}
                <div class="page_list">
                    {!! $joblist->links() !!}
                </div>
            </div>
        </div>
    </div>
@endsection
@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/default/js/company/enjob_list.js')}}"></script>
    <script type="text/javascript">
    $(function() {
        $("#leftnav_job").addClass("active");
        var statusData = [
            {"value": '', "text": "Status limited"},
            {"value": 1, "text": "Release"},
            {"value": 2, "text": "Screened"}
        ];
        var listmenu = $("#job_status").select({
            optionData: statusData,
            callback: function (val, text) {
                window.location = "{{url('company/english/jobadmin')}}?job_status=" + val;
            }
        });
        var operatetip = '';
        $("#operate i").hover(function () {
            operatetip = layer.tips($(this).attr('tip'), this, {
                tips: 1
            });
        }, function () {
            layer.close(operatetip);
        });
        @if(session('info'))
        layer.ready(function(){
            layer.msg("{{session('info')}}");
        });
        @endif
        @if(session('error'))
        layer.ready(function(){
            layer.msg("{{session('error')}}");
        });
        @endif
    });
	</script>
@endsection